import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/common/app_spaces.dart';
import 'package:finance_app/src/widgets/form/form_edit_status_inherited_widget.dart';
import 'package:finance_app/src/widgets/wrapper/normal_form_wrapper.dart';
import 'package:flutter/material.dart';

class ColumnBetweenItemForm extends StatelessWidget {
  final String leftTitle;
  final String leftValue;
  final String rightTitle;
  final String rightValue;
  final VoidCallback onTap;
  final bool isDisable;
  final bool hasBottomBorder;
  final Color textColor;

  const ColumnBetweenItemForm(
      {Key key,
      this.leftTitle,
      this.leftValue,
      this.rightTitle,
      this.rightValue,
      this.onTap,
      this.isDisable,
      this.hasBottomBorder,
      this.textColor})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      onPressed: onTap,
      child: NormalFormWrapper(
        topPadding: getDp(19),
        bottomPadding: getDp(19),
        hasBottomBorder: hasBottomBorder,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  leftTitle ?? '',
                  style: TextStyle(
                    color: aceDarkGrayColor,
                    fontSize: getSp(16),
                    fontWeight: FontWeight.w400,
                    height: 14 / 16,
                  ),
                ),
                AppSpaces.h10,
                Text(
                  leftValue ?? '',
                  style:
                      FormEditStatusInheritedWidget.ofStyle(context, isDisable)
                          .copyWith(color: textColor),
                )
              ],
            ),
            Column(
              crossAxisAlignment: CrossAxisAlignment.end,
              children: [
                Text(
                  rightTitle ?? '',
                  style: TextStyle(
                    color: aceDarkGrayColor,
                    fontSize: getSp(16),
                    fontWeight: FontWeight.w400,
                    height: 14 / 16,
                  ),
                ),
                AppSpaces.h10,
                Text(
                  rightValue ?? '',
                  style:
                      FormEditStatusInheritedWidget.ofStyle(context, isDisable)
                          .copyWith(color: textColor),
                )
              ],
            ),
          ],
        ),
      ),
    );
  }
}
